home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / _divsf3.s < prev    next >
Text File  |  1991-09-24  |  1KB  |  58 lines

  1. # single precision floating point stuff for Atari-gcc using the SFP004
  2. # developed with gas
  3. #
  4. #  single floating point divide routine
  5. #
  6. # M. Ritzert (mjr at dmzrzu71)
  7. #            (ritzert@dfg.dbp.de)
  8. # 4.10.1990
  9. #
  10. # no NAN checking implemented since the 68881 treats this situation "correct",
  11. # i.e. according to IEEE
  12.  
  13. # addresses of the 68881 data port. This choice is fastest when much data is
  14. # transferred between the two processors.
  15.  
  16. comm =     -6
  17. resp =    -16
  18. zahl =      0
  19.  
  20. # waiting loop ...
  21. #
  22. # wait:
  23. # ww:    cmpiw    #0x8900,a0@(resp)
  24. #     beq    ww
  25. # is coded directly by
  26. #    .long    0x0c688900, 0xfff067f8
  27.  
  28.     .even
  29. LC0:
  30.     .ascii "floating point division by 0\12\15\0"
  31.  
  32.     .text
  33.     .even
  34.     .globl    __divsf3, ___divsf3
  35.  
  36. __divsf3:
  37. ___divsf3:
  38.     tstl    a7@(8)            | check if divisor is 0
  39.     bne    continue
  40.     moveml    d0-d7/a0-a6,a7@-
  41.     pea    LC0
  42.     movew    #9,a7@-
  43.     trap    #1
  44.     addql    #6,a7
  45.     moveml    a7@+,d0-d7/a0-a6
  46. continue:
  47.     lea    0xfffa50,a0
  48.     movew    #0x4400,a0@(comm)    | load first argument to fp0
  49.     cmpiw    #0x8900,a0@(resp)    | check
  50.     movel    a7@(4),a0@
  51.     movew    #0x4424,a0@(comm)
  52.     .long    0x0c688900, 0xfff067f8
  53.     movel    a7@(8),a0@
  54.     movew    #0x6400,a0@(comm)    | result to d0
  55.     .long    0x0c688900, 0xfff067f8
  56.     movel    a0@,d0
  57.     rts
  58.